package edu.terapia.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the identity_object_type database table.
 * 
 */
@Entity
@Table(name="identity_object_type")
public class IdentityObjectType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int id;

	private String name;

	//bi-directional many-to-one association to IdentityObject
	@OneToMany(mappedBy="identityObjectType")
	private List<IdentityObject> identityObjects;

	public IdentityObjectType() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<IdentityObject> getIdentityObjects() {
		return this.identityObjects;
	}

	public void setIdentityObjects(List<IdentityObject> identityObjects) {
		this.identityObjects = identityObjects;
	}

	public IdentityObject addIdentityObject(IdentityObject identityObject) {
		getIdentityObjects().add(identityObject);
		identityObject.setIdentityObjectType(this);

		return identityObject;
	}

	public IdentityObject removeIdentityObject(IdentityObject identityObject) {
		getIdentityObjects().remove(identityObject);
		identityObject.setIdentityObjectType(null);

		return identityObject;
	}

}